package com.youthHostel.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.youthHostel.dao.Flatrepairdao;
import com.youthHostel.pojo.flatrepair;
import com.youthHostel.service.FlatrepairService;

@Service
public class FlatrepairServiceImpl implements FlatrepairService{
	@Autowired
	private Flatrepairdao flatrepairdao;

	@Override
	public PageInfo<flatrepair> findAll(int index) {
		PageHelper.startPage(index, 3);
		List<flatrepair> list = flatrepairdao.findAll();
		return new PageInfo<flatrepair>(list);
	}

	@Override
	public int deleteByPrimaryKey(Integer id) {
		return flatrepairdao.deleteByPrimaryKey(id);
	}

	@Override
	public int insert(flatrepair record) {
		return flatrepairdao.insert(record);
	}

	@Override
	public flatrepair selectByPrimaryKey(Integer id) {
		return flatrepairdao.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKey(flatrepair record) {
		return flatrepairdao.updateByPrimaryKey(record);
	}

	@Override
	public List<flatrepair> findByName(String name, int index) {
		return flatrepairdao.findByName(name);
	}

}
